package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.graphics.Bitmap;
import android.view.View;
import android.widget.TextView;
import com.huawei.appgallery.foundation.card.base.card.BaseDistCard;
import com.huawei.appgallery.foundation.ui.css.CSSDeclaration;
import com.huawei.appgallery.foundation.ui.css.adapter.CSSPropertyName;
import com.huawei.appgallery.foundation.ui.css.adapter.type.CSSMonoColor;
import com.huawei.appgallery.foundation.ui.css.adapter.type.CSSValue;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.framework.widget.CustomActionBar;
import com.huawei.appmarket.framework.widget.RenderImageView;
import com.huawei.appmarket.framework.widget.RenderImageView.b;
import com.huawei.appmarket.service.store.awk.bean.ImmersiveHeadAudioCardBean;
import o.azb;
import o.cgz;
import o.chy;
import o.Logger;
import o.eqx;
import o.eqz;
import o.erq;
import o.ewm.d;
import o.ewm.j;

public class ImmersiveHeadAudioCard extends BaseDistCard implements eqz, b {
    private TextView ʻ;
    private TextView ʼ;
    private RenderImageView ˋ;
    private boolean ॱॱ = false;

    public ImmersiveHeadAudioCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        this.ˋ = (RenderImageView) view.findViewById(j.ˊߵ);
        this.ʼ = (TextView) view.findViewById(j.ˊᴵ);
        this.ʻ = (TextView) view.findViewById(j.ˊᵔ);
        this.ˋ.setListener(this);
        ʽ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        ImmersiveHeadAudioCardBean immersiveHeadAudioCardBean = (ImmersiveHeadAudioCardBean) cardBean;
        if (immersiveHeadAudioCardBean.ʼˊ() != null) {
            this.ʼ.setText(immersiveHeadAudioCardBean.ʼˊ());
        }
        if (immersiveHeadAudioCardBean.ʻᐝ() != null) {
            this.ʻ.setText(immersiveHeadAudioCardBean.ʻᐝ());
        }
        eqx.ˎ(this.ˋ, immersiveHeadAudioCardBean.ʻˊ(), "image_default_icon", this, true);
    }

    public void ॱ(Bitmap bitmap) {
        if (bitmap != null) {
            try {
                int ˎ = erq.ˎ(bitmap);
                this.ˋ.setRenderColor(ˎ);
                this.ˋ.setRenderScale(0.3f);
                if (!this.ॱॱ) {
                    CustomActionBar.ˎ(this.ˋ.getContext(), ˎ, this.ˋ.getHeight());
                    boolean ˏ = erq.ˏ(ˎ);
                    ˎ = -16777216;
                    this.ʻ.setAlpha(azb.ˋ(this.ʼॱ, d.ߺ));
                    if (ˏ) {
                        ˎ = -1;
                        this.ʻ.setAlpha(azb.ˋ(this.ʼॱ, d.ॱʿ));
                    }
                    this.ʼ.setTextColor(ˎ);
                    this.ʻ.setTextColor(ˎ);
                    this.ॱॱ = false;
                }
            } catch (IllegalStateException e) {
                Logger.e("ImmersiveHeadAudioCard", e.toString());
            }
        }
    }

    public boolean ˋ(CSSDeclaration cSSDeclaration) {
        CSSValue propertyValue = cSSDeclaration.getPropertyValue(CSSPropertyName.FONT_COLOR);
        if (propertyValue != null && (propertyValue instanceof CSSMonoColor)) {
            this.ॱॱ = true;
        }
        return false;
    }

    public void ॱ(chy o_chy) {
        View ˉ = ˉ();
        if (ˉ != null) {
            ˉ.setOnClickListener(null);
        }
    }
}
